#!/bin/bash
cd ${0%/*} || exit 1


grep "rss" error.out > log.out;
out=`grep -oP "rss: \K\-?[0-9]+\.[0-9]+" log.out`;
echo $out > res.out;


#kcs_u=`grep -oE "\-?[0-9]+\.[0-9]+" mem_kcs_u`
#arr_kcs_u=($kcs_u)
#sum_kcs_u=$( IFS="+"; bc <<< "${arr_kcs_u[*]}" )
#echo $sum_kcs_u
#kcs_v=`grep -oE "\-?[0-9]+\.[0-9]+" mem_kcs_v`
#arr_kcs_v=($kcs_v)
#sum_kcs_v=$( IFS="+"; bc <<< "${arr_kcs_v[*]}" )
#echo $sum_kcs_v
#kcs_w=`grep -oE "\-?[0-9]+\.[0-9]+" mem_kcs_w`
#arr_kcs_w=($kcs_w)
#sum_kcs_w=$( IFS="+"; bc <<< "${arr_kcs_w[*]}" )
#echo $sum_kcs_w
#kcs_p=`grep -oE "\-?[0-9]+\.[0-9]+" mem_kcs_p`
#arr_kcs_p=($kcs_p)
#sum_kcs_p=$( IFS="+"; bc <<< "${arr_kcs_p[*]}" )
#echo $sum_kcs_p
#kcs_s=`grep -oE "\-?[0-9]+\.[0-9]+" mem_kcs_s`
#arr_kcs_s=($kcs_s)
#sum_kcs_s=$( IFS="+"; bc <<< "${arr_kcs_s[*]}" )
#echo $sum_kcs_s
#kcs_e=`grep -oE "\-?[0-9]+\.[0-9]+" mem_kcs_e`
#arr_kcs_e=($kcs_e)
#sum_kcs_e=$( IFS="+"; bc <<< "${arr_kcs_e[*]}" )
#echo $sum_kcs_e
#kcs_k=`grep -oE "\-?[0-9]+\.[0-9]+" mem_kcs_k`
#arr_kcs_k=($kcs_k)
#sum_kcs_k=$( IFS="+"; bc <<< "${arr_kcs_k[*]}" )
#echo $sum_kcs_k
#
#
#swath_u=`grep -oE "\-?[0-9]+\.[0-9]+" mem_swath_u`
#arr_swath_u=($swath_u)
#sum_swath_u=$( IFS="+"; bc <<< "${arr_swath_u[*]}" )
#echo $sum_swath_u
#swath_v=`grep -oE "\-?[0-9]+\.[0-9]+" mem_swath_v`
#arr_swath_v=($swath_v)
#sum_swath_v=$( IFS="+"; bc <<< "${arr_swath_v[*]}" )
#echo $sum_swath_v
#swath_w=`grep -oE "\-?[0-9]+\.[0-9]+" mem_swath_w`
#arr_swath_w=($swath_w)
#sum_swath_w=$( IFS="+"; bc <<< "${arr_swath_w[*]}" )
#echo $sum_swath_w
#swath_p=`grep -oE "\-?[0-9]+\.[0-9]+" mem_swath_p`
#arr_swath_p=($swath_p)
#sum_swath_p=$( IFS="+"; bc <<< "${arr_swath_p[*]}" )
#echo $sum_swath_p
#swath_s=`grep -oE "\-?[0-9]+\.[0-9]+" mem_swath_s`
#arr_swath_s=($swath_s)
#sum_swath_s=$( IFS="+"; bc <<< "${arr_swath_s[*]}" )
#echo $sum_swath_s
#swath_e=`grep -oE "\-?[0-9]+\.[0-9]+" mem_swath_e`
#arr_swath_e=($swath_e)
#sum_swath_e=$( IFS="+"; bc <<< "${arr_swath_e[*]}" )
#echo $sum_swath_e
#swath_k=`grep -oE "\-?[0-9]+\.[0-9]+" mem_swath_k`
#arr_swath_k=($swath_k)
#sum_swath_k=$( IFS="+"; bc <<< "${arr_swath_k[*]}" )
#echo $sum_swath_k
